const button = document.getElementById('myButton');

button.addEventListener('mouseup', function () {
    button.style.transform = 'scale(1)'; // 恢复原始大小
});

button.addEventListener('mousedown', function () {
    button.style.transform = 'scale(0.7)'; // 缩小至70%
});
const input = document.getElementById('myInput');

input.addEventListener('input', function () {
    input.classList.add('active'); // 添加active类
});

input.addEventListener('blur', function () {
    input.classList.remove('active'); // 移除active类
});
const form = document.getElementById('text');

form.addEventListener('submit', function(event) {
    event.preventDefault(); // 阻止表单的默认提交行为
    const abab = document.getElementById('text').value;

});
function sendMessage() {
    const input = document.getElementById('myInput');
    const text = input.value;
    console.log(text); // 输出输入框中的文本
    ainotext('debug1145',text)// 在这里添加发送消息的逻辑
}
function showToast(message, duration) {
    var toastContainer = document.getElementById("toast-container");
    var toastMessage = document.getElementById("toast-message");
  
    clearTimeout(toastContainer.timer); // 清除当前正在显示的toast
    toastMessage.innerText = message;
    toastContainer.style.display = "block";
  
    toastContainer.timer = setTimeout(function () {
      toastContainer.style.display = "none";
    }, duration);
  }
  